﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DC2010_Editor
{
    class b
    {
        // Methods
        public static Color aa(a A_0)
        {
            double num = 0.0;
            double num2 = 0.0;
            double num3 = 0.0;
            if (A_0.b() == 0.0)
            {
                num = num2 = num3 = 0.0;
            }
            else if (A_0.aaa() == 0.0)
            {
                num = num2 = num3 = A_0.b();
            }
            else
            {
                double num5 = (A_0.b() <= 0.5) ? (A_0.b() * (1.0 + A_0.aaa())) : ((A_0.b() + A_0.aaa()) - (A_0.b() * A_0.aaa()));
                double num4 = (2.0 * A_0.b()) - num5;
                double[] numArray = new double[] { A_0.c() + 0.33333333333333331, A_0.c(), A_0.c() - 0.33333333333333331 };
                double[] numArray2 = new double[3];
                for (int i = 0; i < 3; i++)
                {
                    if (numArray[i] < 0.0)
                    {
                        numArray[i]++;
                    }
                    if (numArray[i] > 1.0)
                    {
                        numArray[i]--;
                    }
                    if ((6.0 * numArray[i]) < 1.0)
                    {
                        numArray2[i] = num4 + (((num5 - num4) * numArray[i]) * 6.0);
                    }
                    else if ((2.0 * numArray[i]) < 1.0)
                    {
                        numArray2[i] = num5;
                    }
                    else if ((3.0 * numArray[i]) < 2.0)
                    {
                        numArray2[i] = num4 + (((num5 - num4) * (0.66666666666666663 - numArray[i])) * 6.0);
                    }
                    else
                    {
                        numArray2[i] = num4;
                    }
                }
                num = numArray2[0];
                num2 = numArray2[1];
                num3 = numArray2[2];
            }
            return Color.FromArgb((int)(255.0 * num), (int)(255.0 * num2), (int)(255.0 * num3));
        }

        public static a aa(Color A_0)
        {
            b.a a = new b.a();
            a.aaa(((double)A_0.GetHue()) / 360.0);
            a.b((double)A_0.GetBrightness());
            a.c((double)A_0.GetSaturation());
            return a;
        }

        public static Color aa(Color A_0, double A_1)
        {
            b.a a = b.aa(A_0);
            a.aaa(a.c() * A_1);
            return b.aa(a);
        }

        public static Color bb(Color A_0, double A_1)
        {
            b.a a = b.aa(A_0);
            a.aaa(A_1);
            return b.aa(a);
        }

        public static Color c(Color A_0, double A_1)
        {
            b.a a = b.aa(A_0);
            a.c(a.aaa() * A_1);
            return b.aa(a);
        }

        public static Color d(Color A_0, double A_1)
        {
            b.a a = b.aa(A_0);
            a.c(A_1);
            return b.aa(a);
        }

        public static Color e(Color A_0, double A_1)
        {
            b.a a = b.aa(A_0);
            a.b(a.b() * A_1);
            return b.aa(a);
        }

        public static Color f(Color A_0, double A_1)
        {
            b.a a = b.aa(A_0);
            a.b(A_1);
            return b.aa(a);
        }

        // Nested Types
        public class a
        {
            // Fields
            private double aa = 0.0;
            private double bb = 0.0;
            private double cc = 0.0;

            public double aaa()
            {
                return this.bb;
            }

            public void aaa(double A_0)
            {
                this.aa = A_0;
                this.aa = (this.aa > 1.0) ? 1.0 : ((this.aa < 0.0) ? 0.0 : this.aa);
            }

            public double b()
            {
                return this.cc;
            }

            public void b(double A_0)
            {
                this.cc = A_0;
                this.cc = (this.cc > 1.0) ? 1.0 : ((this.cc < 0.0) ? 0.0 : this.cc);
            }

            public double c()
            {
                return this.aa;
            }

            public void c(double A_0)
            {
                this.bb = A_0;
                this.bb = (this.bb > 1.0) ? 1.0 : ((this.bb < 0.0) ? 0.0 : this.bb);
            }
        }

    }
}
